<template>
	<view class="partyItemWp">
		<view class="partyItemTitle">
			{{item.title?item.title:''}}
		</view>
		<view class="partyItemMain" @click="handleItem(item)" @longpress="longPressItem(item)">
			<view class="infoItem">
				<u-image width="32rpx" height="32rpx"
					src="https://file.casugn.com/storecompcard//8QgtIUYatKvS354eadb67fdb51a33385a045dbd14498_1682221541636.png">
				</u-image>

				<view class="infoName u-line-1">{{item.addressName?item.addressName:''}}</view>
			</view>
			<view class="infoItem">
				<u-image width="32rpx" height="32rpx"
					src="https://file.casugn.com/storecompcard/temp/general／schedule@2x_1682221611794.png">
				</u-image>

				<view class="infoName u-line-1">{{item.startTime?item.startTime:''}}</view>
			</view>
			<view class="infoItem">
				<u-image width="32rpx" height="32rpx"
					src="https://file.casugn.com/storecompcard/temp/general／user@2x_1682221627572.png"></u-image>

				<view style="color:#276AEE ;" class="infoName">{{item.initiator?item.initiator:""}}</view>
			</view>
		</view>
		<u-line dashed margin="24rpx 0" v-if="showLine"></u-line>
		<view class="slotbtnWp" v-if="showBtn">
			<view class="slotbtn">
				<u-button @click="handleBtn(item)" type="primary" :text="btnName">
				</u-button>
			</view>
		</view>

		<view class="markWp">
			<!-- 倒计时时间 -->
			<view class="countDown" v-if="isJoin">
				<u-image src="https://file.casugn.com/storecompcard/temp/general／schedule@2x (1)_1682235613112.png"
					width="32rpx" height="32rpx">
					<template v-slot:loading>
						<u-loading-icon></u-loading-icon>
					</template>
				</u-image>
				<view class="title">
					{{item.time?item.time:''}}
				</view>
			</view>
			<u-image v-if="showMark && item.membersStatus==2" width="140rpx" height="140rpx"
				src="https://file.casugn.com/storecompcard//2RIC5HplUX0i880425d4364b6090f12da57083db1b9f_1682234348571.png">
				<template v-slot:loading>
					<u-loading-icon></u-loading-icon>
				</template>
			</u-image>
			<!-- //未处理 -->
			<u-image v-if="showMark && item.membersStatus==0" width="140rpx" height="140rpx"
				src="https://file.casugn.com/storecompcard/temp/微信图片_20230426114122_1682480519995.png">
				<template v-slot:loading>
					<u-loading-icon></u-loading-icon>
				</template>
			</u-image>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			showLine: {
				type: Boolean,
				default: true
			},
			showBtn: {
				type: Boolean,
				default: true
			},
			item: {
				type: Object
			},
			btnName: {
				type: String,
				default: '组局详情'
			},
			showMark: {
				type: Boolean,
				default: false
			},
			isJoin: {
				type: Boolean,
				default: false
			},
			showChatBtn: {
				type: Number
			}

		},
		data() {
			return {

			}
		},
		methods: {
			handleItem(item) {
				this.$emit('handleItem', item)
			},
			handleBtn(item) {
				this.$emit('handleBtn', item)
			},
			longPressItem(item) {
				this.$emit('longPressItem', item)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.partyItemWp {
		border-radius: 20rpx;
		margin: 24rpx;
		background-color: #fff;
		padding: 24rpx 32rpx;
		position: relative;

		.partyItemTitle {
			width: 100%;
			height: 44rpx;
			font-size: 32rpx;
			font-weight: 600;
			color: #1D2129;
			line-height: 45rpx;
		}

		.partyItemMain {
			.infoItem {
				display: flex;
				align-items: center;
				margin-top: 16rpx;
				width: 100%;
				height: 40rpx;
				font-size: 28rpx;
				font-weight: 400;
				color: #4E5969;
				line-height: 39rpx;

				.infoName {
					margin-left: 16rpx;
				}

			}
		}

		.slotbtnWp {
			width: 100%;
			display: flex;
			justify-content: center;
			align-items: center;

			.slotbtn {
				width: 176rpx;
			}
		}

		.markWp {
			position: absolute;
			top: 20rpx;
			right: 20rpx;

			.countDown {
				display: flex;
				align-items: center;
				margin-bottom: 20rpx;

				.title {
					height: 40rpx;
					font-size: 28rpx;
					font-weight: 400;
					color: #FF7D00;
					line-height: 39rpx;

				}
			}
		}
	}
</style>